package com.sc.nft.admin.rpc;

import com.sc.nft.admin.request.IdRequest;
import com.sc.nft.entity.vo.SaasTaskDetailsCollectionVO;
import com.sc.nft.service.MallProductService;
import com.sc.nft.sup.Result;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.validation.Valid;
import java.util.List;
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/rpc/mall/product")
public class MallProductRpc {
    public final MallProductService mallProductService;

    @PostMapping(value = "/getMallProductSimplenessByIds", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "根据ids获取对应的商品信息", notes = "根据ids获取对应的商品信息", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiIgnore
    public Result<List<SaasTaskDetailsCollectionVO>>  getMallProductSimplenessByIds(@Valid @RequestBody List<Long> ids) {
        return Result.success(mallProductService.getMallProductSimplenessByIds(ids));
    }
}
